<?php

namespace addons\example;

use hiduoke\event\BaseEvent;
use hiduoke\services\FormBuilder as Form;

class Listen extends BaseEvent
{
    /**
     * 插件配置
     * @param $row
     * @return array
     */
    public function example_addon_config($row)
    {
        $rule = array(
            Form::input('secret', '通讯秘钥', $row['secret'] ?? '')->required(),
        );
        return $rule;
    }


    
    // 在头部用户信息左侧显示内容
    public function header_user_left_hook()
    {
        return '<a style="color:#165DFF;margin-right: 10px;font-size:14px;font-weight: bold" href="/gs_developer" target="_blank">🚀开发工具2</a>';
    }

        //      */
    public function customer_menu_hook()
    {
        $user = get_user();
        if(!$user){
            return [];
        }
        return [
            [
                'title' => '2222',
                // 'url'   => '/gs_developer/#/home',
                'url' => 'http://vue3.dkgs.cc/gs_developer#/home',
                //                                'url'   => 'http://localhost:7200',
                'name'  => 'gs_developer2',
                'type'  => 'wujie',
                'target'=>'_blank'
            ],
        ];
    }
}
